package fun.coding.jeffreys.judge;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class TestJavaSandBox {

    /**
     * @param args
     */
    public static void main(String[] args) {
        String filePath = "/tmp/judge";
        
        try {
            // BufferedInputStream bis = new BufferedInputStream(new FileInputStream(new File(filePath)));
            BufferedReader br = new BufferedReader(new FileReader(filePath));
            
            String line;
            
            while ((line = br.readLine()) != null ) {
                System.out.println(line);
            }
            br.close();
            /*
            // Test Http get
            String url = "http://baozitraining.org";
            URL urlObj = new URL(url);
            
            HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();
            con.setRequestMethod("GET");
            
            int code = con.getResponseCode();
            String result = con.getResponseMessage();
            
            System.out.println("code is " + code + " result is " + result);
            BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
            
            String lineInput;
            StringBuffer response = new StringBuffer();
            
            while ((lineInput = in.readLine()) != null) {
                response.append(lineInput);
            }
            
            in.close();
            */
            // System.out.println("response is " + response.toString());
            System.out.println("hello!");
            
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }

    }

}
